import { Buff } from "../class/Effect";
import { Game } from "../class/Game";
import { Role } from "../class/Role";
import { Shield } from "../class/Shield";
import { Cure } from "../methods/治愈";

export class JingGangLang extends Role {
    static roleName = "金刚狼";
    static roleDescription = "拥有者极强的生存能力,被动:每隔 20S 获得 1000 点护盾(不可累加),被动:1点物理防御可以转换成1点物理攻击。"
    protected MAXHP: number = 12000;
    protected HP: number = 12000;
    protected PD: number = 800;
    protected MD: number = 800;
    protected PA: number = 800;
    protected MA: number = 800;
    static methods = [Cure];
    constructor(userId: string, userName: string, game: Game) {
        super(userId, userName, game);
        this.addEffectByClass(class extends Buff {
            public sumTime: number = game.startTimeLength;
            public eachTime: number = 20E3;
            public invoke(): void {
                this.masterRole.setShield(new Shield(1000))
            }
        })
    }

    getMagicAttack() {
        return super.getMagicAttack() + this.getMaginDefend()
    }
}